<xsl:stylesheet version="1.0" 
	xmlns:date="http://exslt.org/dates-and-times"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="date">

<xsl:output omit-xml-declaration="yes" />

<xsl:param name="IsBlogOwner" />
<xsl:param name="RelativeUrl" />

<xsl:template match="/">
	<div class="comments">
		<h2>Links to this post</h2>
		<xsl:apply-templates select="rows/row"/>
	</div>
</xsl:template>

<xsl:template match="row">
	
	<div><xsl:attribute name="class"><xsl:choose><xsl:when test="position() mod 2 = 0">comments-author</xsl:when><xsl:otherwise>comments-visitor</xsl:otherwise></xsl:choose></xsl:attribute>
		<xsl:variable name="publishedDate" select="date:parseDate(Created, 'yyyy-MM-dd HH:mm:ss')"/>
		<xsl:choose>
			<xsl:when test="LinkbackType = 'Pingback'">
				<p>
					[...] <xsl:value-of select="PostExcerpt" disable-output-escaping="yes" /> [...]
				</p>	
		
				<span class="comments-intro">
					Pingback from 
						<a href="{substring-before(PostName,',')}"><xsl:value-of select="BlogName"/></a>
					on <xsl:value-of select="date:format-date($publishedDate, 'dd MMM yyyy hh:mm')"/>
				</span>			
			</xsl:when>
			<xsl:otherwise>
				<span class="comments-intro">
					<xsl:value-of select="substring-after(PostName,', ')"/>
				</span>

				<p>
					<xsl:if test="PostExcerpt != ''">
						[...] <xsl:value-of select="PostExcerpt" disable-output-escaping="yes" /> [...]
					</xsl:if>						
				</p>
				
						
				<span class="comments-intro">
					Trackback from 
						<a href="{substring-before(PostName,',')}"><xsl:value-of select="BlogName"/></a>
					on <xsl:value-of select="date:format-date($publishedDate, 'dd MMM yyyy hh:mm')"/>
				</span>
			</xsl:otherwise>
		</xsl:choose>
	</div>
</xsl:template>
 
</xsl:stylesheet>
